import java.util.Scanner;

/**
 * 查找输入整数二进制中1的个数
 */
public class FindOneCountInBinaryString {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int num = scanner.nextInt();
            String binaryString = Integer.toBinaryString(num);
            int count = 0;
            for (int i=0; i<binaryString.length(); i++) {
                if (binaryString.charAt(i) == '1') {
                    count++;
                }
            }
            System.out.println(count);
        }
    }
}
